package com.sunyifeng.ch10;

public class DecoratorPatternDemo {

    public static void main(String[] args) {

        Shape circle = new Circle();
        ShapeDecorator redCircle = new RedShapeDecorator(new Circle());
        ShapeDecorator redRectangle = new RedShapeDecorator(new Rectangle());

        //Shape redCircle = new RedShapeDecorator(new Circle());
        //Shape redRectangle = new RedShapeDecorator(new Rectangle());

        System.out.println("画一个正常边框的圆");
        circle.draw();

        System.out.println("\n画一个红色边框的圆，要用到装饰器");
        redCircle.draw();

        System.out.println("\n画一个红色边框的矩形，要用到装饰器");
        redRectangle.draw();
    }
}
